Animation Commands


MoveObject ("Object","x,y,w,h")
Move (and/or resize) the object (or group) to the x,y position. The w and h parameters are not required and if they are defined the object is resized - However it won't resize any bitmap object or text - it resize only its active boundaries. But it works fine for rectangle, buttons, hotspots...etc..
You can make a code:


For i=0 To 100
MoveObject ("Bitmap","i,20 ")
Refresh ()
Pause(" 30")
Next i

and it will move the object form left to right!

 

MoveTo ("Object","x,y,steps,type")
This simple command moves object (or group) from current position to the x,y using # of steps. The type can be EASYTO, EASYFROM or none to define the linearity in time. It basically does the same as code above, however you can specify slowing or accelerating with the TYPE.
EASYTO starts with normal speed and slows down as it approaches the end. point

EASYFROM starts slowly and then it accelerates

 

Refresh ()
This command will force to redraw the changes. It also works like a pump, if you use Refresh() in a loop the program reminds active and in fact you can still interact with the active objects (while the loop is continuing).

 

Pause("ms")
Pause command in the script, takes a number of ms to pause before continuing the script.
Note: this will result in semi-parallel processing. While the script is pausing, the rest of the project is active and in fact, you can run by some action the same script again.

NOTE: The Pause command causes a raising the level of CPU usage. Therefore, use it only if you really need it. To avoid this unpleasant property, use the combination of ScriptTimers. Open the scrollingtext.mbd sample file to see how.